﻿using System;
using System.Collections.Generic;
using System.Text;
using Sven.Core;
using Microsoft.Extensions.DependencyInjection;

namespace Sven.Web.Framework
{
    public class SvenEngine : IEngine
    {
        private static IServiceProvider _serviceProvider = null;

        public SvenEngine(IServiceProvider serviceProvider)
        {
            _serviceProvider = serviceProvider;
        }
         

        /// <summary>
        /// 创建实例
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        public T Resolve<T>() where T : class
        {
            return _serviceProvider.GetService<T>();
        }
    }
}
